<template lang="pug">
  .tab-1
    Table.hasTitle-table.beautiful-table(:columns="thead" :data="feedBackList")
      //- .pr-24.pl-24(slot="header")
      //-   .pull-right
      //-     Button.mr-15(type="info" size="small" @click="addContact") 添加联系人
      template(slot-scope="{ row, index }" slot="2d")
        Button(size="small") 查看
      //- template(slot-scope="{ row, index }" slot="action")
        Button.mr-10(type="info" size="small" @click="reviseBtn") 修改
        Button(type="warning" size="small") 删除
    Modal(v-model="reviseModal" title="签约")
      Form(ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="130")
        FormItem.mb-5(label="所属需求：" prop="name")
          Input(placeholder="请输入")
        FormItem.mb-5(label="合作名称：" prop="date")
          Input(placeholder="请输入")
        FormItem.mb-5(label="合作价格：" prop="date")
          Input(placeholder="请输入")
        FormItem.mb-5(label="合作内容：" prop="aadd")
          Input(placeholder="请输入")
        FormItem.mb-5(label="谈判挑战：" prop="aadd")
          Input(placeholder="请输入")
        FormItem.mb-5(label="谈判策略：" prop="aadd")
          Input(placeholder="请输入")
        FormItem.mb-5(label="备注信息：")
          Input(type="textarea" placeholder="请输入")
      template(slot="footer")
        Button(type="info" @click="handleSubmit('formValidate')") 提交
        Button(@click="reviseModal = false") 取消
</template>

<script>
export default {
  props: {
    feedBackList: Array
  },
  data () {
    return {
      isCheck: true,
      name: '总经理',
      reviseModal: false,
      thead: [
        {
          title: '所属合同',
          minWidth: 100,
          key: 'contractNo'
        },
        {
          title: '课程/项目名称',
          minWidth: 130,
          key: 'projectName'
        },
        {
          title: '课程/项目开始日期',
          minWidth: 160,
          render: (h, params) => {
            let row = params.row
            let times = ''
            if (row.startTime) {
              times = row.startTime.slice(0, 10)
            }
            return h('span', times)
          }
        },
        {
          title: '课程/项目结束日期',
          minWidth: 160,
          render: (h, params) => {
            let row = params.row
            let times = ''
            if (row.endTime) {
              times = row.endTime.slice(0, 10)
            }
            return h('span', times)
          }
        },
        {
          title: '销售评价',
          minWidth: 100,
          key: 'salerFeedback'
        },
        {
          title: '讲师评价',
          minWidth: 100,
          key: 'teacherFeedback'
        },
        {
          title: '客户负责人评价',
          minWidth: 140,
          key: 'customerFeedback'
        },
        {
          title: '学员评价',
          minWidth: 100,
          key: 'studentFeedback'
        },
        {
          title: '交付顾问评价',
          minWidth: 130,
          key: 'pmFeedback'
        },
        {
          title: '综合评价',
          minWidth: 100,
          key: 'score'
        }
        // {
        //   title: '操作',
        //   minWidth: 140,
        //   slot: 'action'
        // }
      ],
      formValidate: {
        name: '',
        phone: ''
      },
      ruleValidate: {
        name: [
          { required: true, trigger: 'blur' }
        ],
        date: [
          { type: 'date', required: true, trigger: 'change' }
        ],
        aadd: [
          { required: true, trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    reviseBtn () {
      this.reviseModal = true
    },
    handleSubmit (name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          this.$Message.success('Success!')
        } else {
          this.$Message.warning('有必填项未填写！')
        }
      })
    }
  }
}
</script>

<style>

</style>
